<?php
    require_once('DataBaseQuery.php');
    if((!isset($_POST["myusername2"])) || (!isset($_POST["mypassword2"])))
         header('Location: welcome.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>AdCo Editor | Collaborative Editor</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />
    <link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header"><div id="header2">
            <div id="logo">
                <h1><a href="#">AdCo Editor</a></h1>
                <p id="subtitle">Online Editor</p>
            </div> 
            <div id="menu">
                <ul>
                    <li><a href="welcome.php">Home</a></li>
                    <li><a href="#">About</a></li>
                    <li><a href="#">Services</a></li>
                    <li><a href="#">Gallery</a></li>
                    <li><a href="#">Help</a></li>
                    <li><a href="#">Contact</a></li>
                </ul>
            </div>
    </div></div><!-- header --><!-- header2 -->
    <div id="main"><div id="main2">	
            <div id="sidebar">
            </div><!-- sidebar -->    	              
            <div id="content">			
                <div class="post">
                    <h2><a href="#">Info</a></h2>
		    <?php
                        if($_POST["myusername2"] == null)
                            echo "<font color = ".'"red"'.">"."Warning: Please complete the ".'"username" field'."</font>";
                        if($_POST["mypassword2"] == null)
                            echo "<br>"."<font color = ".'"red"'.">"."Warning: Please complete the ".'"password" field'."</font>";
                        if(($_POST["myusername2"] == null) || ($_POST["mypassword2"] == null))
                            echo "<br><input type=button onClick=".'"parent.location='."'welcome.php'".'"'." value=".'"Back"><br><br>';
                        else
                        {
                            $add = insertUser($_POST["myusername2"], $_POST["mypassword2"]);
                            
                            if($add)
                            {
                                echo "Your account has been created. Welcome "."<b><font color = ".'"green">'.$_POST["myusername2"]."</font></b>";
                                echo "<br><input type=button onClick=".'"parent.location='."'welcome.php'".'"'." value=".'"Login"><br><br>';
                                mkdir("./files/".$_POST["myusername2"], 0700);
                            }
                        }
                    ?>
                </div>
                <div class="post">
                    <h2><a href="#">sdadasad</a></h2>
                    
                </div>							              
            </div><!-- content -->                    
            <div class="clearing">&nbsp;</div>   
    </div></div><!-- main --><!-- main2 -->
    <div id="footer"><div id="footer2">
            <p>Copyright &copy; 2011, designed by <a href="http://www.webtemplateocean.com/">WebTemplateOcean.com</a></p>
    </div></div>
<div style="text-align: center; font-size: 0.75em;">Design downloaded from <a href="http://www.freewebtemplates.com/">free website templates</a>.</div></body>
</html>